<%-- 
    Document   : nuevo
    Created on : 16/02/2011, 04:23:36 PM
    Author     : WILLIAM
--%>

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib prefix="t" uri="http://myfaces.apache.org/tomahawk"%>
<%@taglib prefix="r" uri="http://richfaces.ajax4jsf.org/rich" %>
<%@taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<script language="javascript" src="../js/funciones.js"></script>
<script language="javascript" src="../js/scripts.js"></script>
<link href="/sistemas/Estilos/estilosEsymons.css" rel="stylesheet" type="text/css" />

<f:view>
    <h:form enctype="multipart/form-data">
<table width="100%" border="0">
  <tr>
    <td height="26" align="left" class="texto3">
    <h:outputLabel value="Nueva Imagen" styleClass="texto3" /></td>
  </tr>
  <tr><td height="20">
    <a4j:outputPanel ajaxRendered="true">
    <h:messages id="lblMessages" styleClass="messages" infoClass="infoClass" errorClass="errorClass"
                warnClass="warnClass" showDetail="true" errorStyle="color:red;"
                warnStyle="color:green;" infoStyle="color:black;" fatalStyle="color:black"/>
    </a4j:outputPanel>
      </td>
  </tr>
  <tr><td align="center">
  <fieldset><legend>Datos de Imagen</legend>
  <table width="763" border="0" cellpadding="0" cellspacing="0">
  <tr>
      <td width="110" height="25" align="left" valign="middle">
          <h:outputLabel value="Categoria: " styleClass="texto22" /></td>
      <td width="403" height="25" align="left" valign="middle">
          <h:selectOneMenu value="#{galeriaController.galeria.galCategoria}" styleClass="fondo012">
              <f:selectItem itemValue="" itemLabel="-----Seleccionar-----" />
              <f:selectItem itemValue="Capitulos" itemLabel="Capitulos" />
              <f:selectItem itemValue="Colegiatura" itemLabel="Colegiatura" />
              <f:selectItem itemValue="Cursos" itemLabel="Cursos" />
              <f:selectItem itemValue="Eventos" itemLabel="Eventos" />
              <f:selectItem itemValue="Varios" itemLabel="Varios" />
          </h:selectOneMenu></td>
    <td width="110" height="25"></td>
    <td width="140" height="25"></td>
  </tr>
  <tr>
    <td height="25" align="left" valign="middle"><h:outputLabel value="Nombre: " styleClass="texto22" /></td>
    <td height="20" align="left" valign="middle">  
        <h:inputText value="#{galeriaController.galeria.galNombre}" size="40"  styleClass="fondo012" />
    </td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td height="25" align="left" valign="middle">
        <h:outputLabel value="Título: " styleClass="texto22" /></td>
    <td height="20" align="left" valign="middle">
        <h:inputText value="#{galeriaController.galeria.galTitulo}" size="40" styleClass="fondo012" /></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td height="25" align="left" valign="middle">
        <h:outputLabel value="Fecha: " styleClass="texto22" /></td>
    <td height="20" align="left" valign="middle">
        <r:calendar value="#{galeriaController.galeria.galFecha}"
        datePattern="dd/MM/yyyy" cellWidth="15" inputClass="cajaCentrada" styleClass="cajaCentrada"/></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td height="25" align="left" valign="middle">
        <h:outputLabel value="Comentario: " styleClass="texto22" /></td>
    <td height="20" align="left" valign="middle">
        <h:inputText value="#{galeriaController.galeria.galComentario}" size="60" styleClass="fondo012" /></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td height="25" align="left" valign="middle">
        <h:outputLabel value="Adjuntar: " styleClass="texto22" /></td>
    <td height="20" align="left" valign="middle">
        <t:inputFileUpload size="60" storage="file" value="#{galeriaController.upFile}"/>
        <h:commandButton action="#{galeriaController.upload}" value="Adjuntar" styleClass="enlace9"/></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td height="35" colspan="4">
        <!--h:commandButton action="" value="Registrar" styleClass="enlace9" /-->
        <h:outputLabel value=" " />
        <h:commandButton action="#{galeriaController.cancelar}" value="Cancelar" styleClass="enlace9" />
    </td>
    </tr>
 
  </table>
  </fieldset>
     </td>
  </tr>
  <h:panelGroup rendered="#{galeriaController.activar==true}">
  <tr><td align="center">
  <fieldset><legend>Imagenes Adjuntas</legend>
  <table width="926" border="0" cellpadding="0" cellspacing="0">
   <tr><td colspan="5" align="center">
           <r:dataTable value="#{galeriaController.listarImagenAdjunta}" var="imagen" rows="10" rowClasses="TableImpar,TablePar"
        reRender="dt" id="TableImagen" border="0" headerClass="texto18">
       <r:column width="20%">
            <f:facet name="header"><h:outputLabel value="Categoria" /></f:facet>
            <h:outputLabel value="#{imagen.galCategoria}" styleClass="texto20" />
        </r:column>
        <r:column width="25%">
         <f:facet name="header"><h:outputLabel value="Nombre" /></f:facet>
            <h:outputLabel value="#{imagen.galNombre}" styleClass="texto20" />
        </r:column>
        <r:column width="20%">
            <f:facet name="header"><h:outputLabel value="Titulo" /></f:facet>
            <h:outputLabel value="#{imagen.galTitulo}" styleClass="texto20" />
        </r:column>
       <r:column width="20%">
            <f:facet name="header"><h:outputLabel value="Fecha" /></f:facet>
            <h:outputLabel value="#{imagen.galFecha}" styleClass="texto20" />
        </r:column>       
        <r:column width="5%">
            <f:facet name="header"></f:facet>&nbsp;&nbsp;
            <h:commandButton action="#{galeriaController.remover}" image="/image/eliminar.png" title="remover">
                <f:setPropertyActionListener target="#{galeriaController.galeria}" value="#{imagen}"/>
            </h:commandButton>
        </r:column>
        <f:facet name="footer">
          <r:datascroller id="dt" renderIfSinglePage="false"></r:datascroller>
        </f:facet>
    </r:dataTable>
        </td>
    </tr>
  </table>
  </fieldset>
    </td>
  </tr>
  </h:panelGroup>
</table>
</h:form>
</f:view>
